package main

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

/**
  RESTful API开发实例
*/
func main() {
	engine := gin.Default()
	engine.GET("/user", func(context *gin.Context) {
		context.JSON(http.StatusOK, gin.H{
			"message": "GET",
		})
	})
	engine.POST("/user", func(context *gin.Context) {
		context.JSON(http.StatusOK, gin.H{
			"message": "POST",
		})
	})
	engine.PUT("/user", func(context *gin.Context) {
		context.JSON(http.StatusOK, gin.H{
			"message": "PUT",
		})
	})
	engine.DELETE("/user", func(context *gin.Context) {
		context.JSON(http.StatusOK, gin.H{
			"message": "DELETE",
		})
	})
	engine.Run(":8088")
}
